import '@/plugins/axios'
import '@/plugins/element.js'

export default queryRecords;

function queryRecords(seat) {
  console.log("queryRecords");
  return new Promise((resolve, reject) => {
    this.axios
      .get("./api/model_indicator_query_records.php?", {
        params: { seat },
        timeout: 5000,
      })
      .then((response) => {
        console.log("queryRecords", response.data);
        if (response.data.count > 0) {
          resolve();
        } else {
          this.$message.warning("");
          resolve('');
        }
      })
      .catch((error) => {
        console.error("queryRecords", error);
        this.$message.error("");
        reject(error);
      });
  });
}